--[[/**
-- *
 * [攻击万分比】，就是下一次任意攻击的计算前，技能攻击力+这个参数值
 *
-- *
-- */]]

---@class BuffEffect496403 : BaseBuffEffect
BuffEffect496403 = ClientFight.CreateClass("BuffEffect496403", ClientFight.BaseBuffEffect)
local t = BuffEffect496403

---@param fight Fight
---@param buff FighterBuff
function t: add( fight, buff) 
local buffEffectValue = buff.buffBean.f_BuffEffectValue;
local target = buff.target;
local skillHurtCorrectMap =  target.parametersByObject[FightUsingSkill.HurtCorrectFactor] or {};

local old = skillHurtCorrectMap[1] or 0;
skillHurtCorrectMap[1] = old + buffEffectValue[1];

SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
.. buff.modelId.. " 增加技能的攻击系数值:" .. getJsonStr(buffEffectValue));
target.parametersByObject[FightUsingSkill.HurtCorrectFactor] = skillHurtCorrectMap;
return ClientFight.BaseBuffEffect.add(self,fight, buff);
end

function t:remove( fight, buff, force,...)
    local  parameters = {...};
    local buffEffectValue = buff.buffBean.f_BuffEffectValue;
    local target = buff.target;
    local skillHurtCorrectMap =  target.parametersByObject[FightUsingSkill.HurtCorrectFactor] or {};

    local old = skillHurtCorrectMap[1] or 0;
    local value = old - buffEffectValue[1];
    if (value < 0 )then
        value = 0;
    end
    skillHurtCorrectMap[1] = value;

    SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
            .. buff.modelId.. " 减少技能的攻击系数值:" .. getJsonStr(buffEffectValue));
    target.parametersByObject[FightUsingSkill.HurtCorrectFactor] = skillHurtCorrectMap;

    return ClientFight.BaseBuffEffect.remove(self,fight, buff, force, ...);
end

t.New()